﻿using RM.BasicLibrary.Exceptions;
using System;

namespace RM.BasicLibrary
{
    public abstract class BaseException : Exception
    {
        public CodeInfo BaseExceptionInfo { get; set; }
        public BaseException(CodeInfo baseExceptionInfo) : base(baseExceptionInfo.Msg)
        {

        }
        public BaseException(string ex) : base(ex)
        {
            BaseExceptionInfo = Root.Ins.CodeInfo.GetCodeInfo(3, true, ex);
        }
        public BaseException(string ex, Exception innerException) : base(ex, innerException)
        {
            BaseExceptionInfo = Root.Ins.CodeInfo.GetCodeInfo(3, true, ex);
        }
    }
    public class BusinessException : BaseException
    {
        public BusinessException(string ex) : base(ex)
        {

        }
        public BusinessException(CodeInfo baseExceptionInfo) : base(baseExceptionInfo)
        {

        }
    }
    public class ParameterException : BaseException
    {
        public ParameterException(CodeInfo baseExceptionInfo) : base(baseExceptionInfo)
        {

        }
        //
        // 摘要:
        //     Initializes a new instance of the System.ArgumentNullException class with the
        //     name of the parameter that causes this exception.
        //
        // 参数:
        //   paramName:
        //     The name of the parameter that caused the exception.
        public ParameterException(string message) : base(message)
        {

        }
    }
    internal class BasicException : BaseException
    {
        public BasicException(CodeInfo baseExceptionInfo) : base(baseExceptionInfo)
        {

        }
        internal BasicException(string ex) : base(ex)
        {

        }
        internal BasicException(string ex, Exception innerException) : base(ex, innerException)
        {

        }
    }
    internal class BasicLibraryException : BasicException
    {
        public BasicLibraryException(CodeInfo baseExceptionInfo) : base(baseExceptionInfo)
        {

        }
        internal BasicLibraryException(string ex) : base(ex)
        {

        }
        internal BasicLibraryException(string ex, Exception innerException) : base(ex, innerException)
        {

        }
    }
}
